package com.settlement.system.common.enums;


import com.settlement.system.common.util.common.EnumUtil;

/**
 * FSP返回枚举
 * @author hc
 * @since 2022/4/6
 */
public enum StandardStatusEnum implements Code<Long>{
    /** 基本校验异常 */VALID_ERROR(10001, "基本校验异常"),
    /** 批量发送给NC失败 */MULTI_FAILURE(10002, "批量发送给NC失败"),
    /** 转换异常 */CONVERT_EXCEPTION(10003, "转换异常"),
    /** NC处理成功 */MULTI_OK(10004, "NC处理成功"),
    /** 冲销校验异常 */WRITEOFF_ERROR(10005, "冲销校验异常"),
    /** 转换异常 */FSP_CONVERT_EXCEPTION(10006, "转换异常"),
    /** 自定义凭证校验异常 */CUSTOM_VOUCHER_ERR(10007, "自定义凭证校验异常"),
    /** 请求NC单条成功且生成单据成功 */SINGLE_OK(20001, "请求NC单条成功且生成单据成功"),
    /** 请求NC单条成功但生成单据失败 */SINGLE_FAILURE(20002, "请求NC单条成功但生成单据失败"),
    /** 调用NC单条接口异常 */SINGLE_NC_EXCEPTION(20003, "调用NC单条接口异常"),
    ;

    private final long code;
    private final String name;

    StandardStatusEnum(long code,String name){
        this.code=code;
        this.name=name;
    }

    /**
     * 数值获取对应的 StandardStatusEnum
     * @param code
     * @return
     */
    public static StandardStatusEnum witch(long code){
        return EnumUtil.witch(code,StandardStatusEnum.class,null);
    }


    @Override
    public Long code() {
        return code;
    }
}
